Program debugging is a process in which a compiled computer program is tested manually or by using a method such as a compiling program before the compiled computer program is put into actual operation, so as to correct a syntax error and a logic error. This is an indispensable step for ensuring correctness of a computer information system. Therefore, the compiled computer program needs to be loaded into a computer for debugging.
Generally, code that runs in kernel space is referred to as kernel mode code, and code that runs in user space is referred to as user mode code in the industry. Currently, different debugging platforms need to be used to debug the kernel mode code and the user mode code. It should be noted that, a target machine described below refers to a physical machine in which the debugged code runs, and a host machine refers to a physical machine in which a debugger runs. For example, when user mode code is debugged, a debugger needs to run in an operating system of a target machine to perform local debugging; or when user mode code is debugged, a process tracing module (Ptrace) needs to be implanted into an operating system of a target machine, a debugging stub may further need to run in the operating system, and then a debugger runs in a host machine to perform remote debugging. When kernel mode code such as a kernel module is debugged, a kernel debugger needs to be implanted into an operating system of a target machine, and then a debugger runs in a host machine to perform remote debugging.